package com.zxkj;

import com.zxkj.service.*;
import jdk.nashorn.internal.ir.debug.PrintVisitor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.util.StringUtils;

@SpringBootApplication
public class FixSolrApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(FixSolrApplication.class, args);
    }

    @Autowired
    private FixService fixService;
    @Autowired
    private UtInfoService utInfoService;
    @Autowired
    private CitedService citedService;


    @Override
    public void run(String... args) throws Exception {

        /*
         * 修复wos和本地数据不准确
         */
        Integer startPage = 0;//开始的页数，默认0
        Integer endPage = 0;//结束的页数，默认0
        if (args.length > 0) {
            startPage = Integer.parseInt(args[0]);
        }
        if (args.length > 1) {
            endPage = Integer.parseInt(args[1]);
        }
        fixService.fixMain(startPage,endPage);
//        fixService.insertIntoCorpAu();
//        utInfoService.mysql2File(startPage,endPage);
//        citedService.updateSolr(startPage,endPage);
    }

}
